<?php
$result = $this->result;
$id=$this->id;
$strarray = array ('k1', 'k2', 'k3', 'k4', 'k5', 'u1', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7', 'g8', 'g9', 'g10' );
foreach ( $result as $res ) {
	
	for($i = 0; $i < count ( $strarray ); $i ++) {
		if ($strarray [$i] == $res)
			$strarray [$i] = "checked='checked'";
	}
	;
}
;
for($i = 0; $i < count ( $strarray ); $i ++) {
	if ($strarray [$i] != "checked='checked'")
		$strarray [$i] = "";
}
?>

<script type="text/javascript">
		window.addEvent('domready',function function_name() {
			$('back').addEvent('click',function function_name() {
					$('myForm').action='manage';
				;
			}
			);
//			$('myForm').addEvent('submit', function(event){
//				   event.preventDefault();
//			}); 
//			$('ok').addEvent('click',function(){
//										
//							$('myForm').set('send',{
//								update:$('content'),
//								onSuccess:function function_name() 
//							{
//									alert("Xong !")
//								}
//								}).send();
			});
	
</script>



<div class="center_title_bar">PHÂN QUYỀN HỆ THỐNG----MÃ THÀNH VIÊN <?php echo $id?> </div>
<div class="prod_box_big">
<div class="top_prod_box_big"></div>
<div class="center_prod_box_big">
<form id="myForm" action="ganquyen">
<table border="1" id="myTable" style="width: 500px">
	<thead>
		<tr>
			<td width="12%">Mã Quyền</td>
			<td width="81%">Tên Quyền</td>
			<td width="7%">&nbsp;</td>
		</tr>
	</thead>

	<tr>
		<td colspan="3" align="center" class="tr1">Nhóm Quyền Dành Cho Khách</td>

	</tr>
	<tr>
		<td align="center">k1</td>
		<td>Xem Thông Tin Sản Phẩm</td>
		<td><input type="checkbox" <?php
		echo $strarray [0]?> name="k1"
			value="k1" /></td>
	</tr>
	<tr>
		<td align="center">k2</td>
		<td>Xem B&#7843;n Tin</td>
		<td><input type="checkbox" <?php
		echo $strarray [1]?> name="k2"
			value="k2" /></td>
	</tr>
	<tr>
		<td align="center">k3</td>
		<td>Xem Report S&#7843;n Ph&#7849;m</td>
		<td><input type="checkbox" <?php
		echo $strarray [2]?> name="k3"
			value="k3" /></td>
	</tr>
	<tr>
		<td align="center">k4</td>
		<td>G&#7917;i Ph&#7843;n &Aacute;nh Kh&aacute;ch H&agrave;ng</td>
		<td><input type="checkbox" <?php
		echo $strarray [3]?> name="k4"
			value="k4" /></td>
	</tr>
	<tr>
		<td align="center">k5</td>
		<td>&#272;&#7863;t H&agrave;ng Tr&#7921;c Tuy&#7871;n</td>
		<td><input type="checkbox" <?php
		echo $strarray [4]?> name="k5"
			value="k5" /></td>
	</tr>
	<tr>
		<td colspan="3" align="center" class="tr1">Nhóm Quyền Dành Cho User</td>
	</tr>
	<tr>
		<td align="center">u1</td>
		<td>Nhận Thông Tin Qua Mail</td>
		<td><input type="checkbox" <?php
		echo $strarray [5]?> name="u1"
			value="u1" /></td>
	</tr>
	<tr>
		<td colspan="3" align="center" class="tr1">Nhóm Quyền Dành Cho Admin</td>
	</tr>
	<tr>
		<td align="center">a1</td>
		<td>Quản Lý Tài Khoản Người Dùng</td>
		<td><input type="checkbox" <?php
		echo $strarray [6]?> name="a1"
			value="a1" /></td>

	</tr>
	<tr>
		<td align="center">a2</td>
		<td>Tạo Email Gửi Khách Hàng</td>
		<td><input type="checkbox" <?php
		echo $strarray [7]?> name="a2"
			value="a2" /></td>
	</tr>
	<tr>
		<td align="center">a3</td>
		<td>Qu&#7843;n L&yacute; Send mail</td>
		<td><input type="checkbox" <?php
		echo $strarray [8]?> name="a3"
			value="a3" /></td>
	</tr>
	<tr>
		<td align="center">a4</td>
		<td>Qu&#7843;n L&yacute; S&#7843;n Ph&#7849;m</td>
		<td><input type="checkbox" <?php
		echo $strarray [9]?> name="a4"
			value="a4" /></td>
	</tr>
	<tr>
		<td align="center">a5</td>
		<td>Qu&#7843;n L&yacute; &#272;&#417;n &#272;&#7863;t H&agrave;ng</td>
		<td><input type="checkbox" <?php
		echo $strarray [10]?> name="a5"
			value="a5" /></td>
	</tr>
	<tr>
		<td align="center">a6</td>
		<td>Xem Report</td>
		<td><input type="checkbox" <?php
		echo $strarray [11]?> name="a6"
			value="a6" /></td>
	</tr>
	<tr>
		<td align="center">a7</td>
		<td>Qu&#7843;n L&yacute; Tin T&#7913;c</td>
		<td><input type="checkbox" <?php
		echo $strarray [12]?> name="a7"
			value="a7" /></td>
	</tr>
	<tr>
		<td colspan="3" align="center" class="tr1">Nhóm Quy&#7873;n N&acirc;ng
		Cao</td>
	</tr>
	<tr>
		<td align="center">g1</td>
		<td>&#272;&#259;ng S&#7843;n Ph&#7849;m</td>
		<td><input type="checkbox" <?php
		echo $strarray [13]?> name="g1"
			value="g1" /></td>
	</tr>
	<tr>
		<td align="center">g2</td>
		<td>Xem Danh S&aacute;ch S&#7843;n Ph&#7849;m</td>
		<td><input type="checkbox" <?php
		echo $strarray [14]?> name="g2"
			value="g2" /></td>
	</tr>
	<tr>
		<td align="center">g3</td>
		<td>S&#7917;a Th&ocirc;ng Tin S&#7843;n Ph&#7849;m</td>
		<td><input type="checkbox" <?php
		echo $strarray [15]?> name="g3"
			value="g3" /></td>
	</tr>
	<tr>
		<td align="center">g4</td>
		<td>X&oacute;a S&#7843;n Ph&#7849;m</td>
		<td><input type="checkbox" <?php
		echo $strarray [16]?> name="g4"
			value="g4" /></td>
	</tr>
	<tr>
		<td align="center">g5</td>
		<td>&#272;&#259;ng Tin T&#7913;c</td>
		<td><input type="checkbox" <?php
		echo $strarray [17]?> name="g5"
			value="g5" /></td>
	</tr>
	<tr>
		<td align="center">g6</td>
		<td>Xem danh s&aacute;ch tin t&#7913;c</td>
		<td><input type="checkbox" <?php
		echo $strarray [18]?> name="g6"
			value="g6" /></td>
	</tr>
	<tr>
		<td align="center">g7</td>
		<td>S&#7917;a tin t&#7913;c</td>
		<td><input type="checkbox" <?php
		echo $strarray [19]?> name="g7"
			value="g7" /></td>
	</tr>
	<tr>
		<td align="center">g8</td>
		<td>X&oacute;a tin t&#7913;c</td>
		<td><input type="checkbox" <?php
		echo $strarray [20]?> name="g8"
			value="g8" /></td>
	</tr>
	<tr>
		<td align="center">g9</td>
		<td>Check &#273;&#417;n &#273;&#7863;c h&agrave;ng</td>
		<td><input type="checkbox" <?php
		echo $strarray [21]?> name="g9"
			value="g9" /></td>
	</tr>
	<tr>
		<td align="center">g10</td>
		<td>G&#7917;i mail spam t&#7899;i user</td>
		<td><input type="checkbox" <?php
		echo $strarray [22]?> name="g10"
			value="g10" /></td>
	</tr>

</table>
<p align="center">
<input id="ok" type="submit" value="Save"> <input id="back"
	type="submit" value="Back"></form>
	
</div>
<div class="bottom_prod_box_big"></div>
</div>